import Vue from 'vue'
import App from './App'
import router from './router/index'
import store from './vuex/store'
import './assets/iconfont.css'
import './assets/common.css'
import './assets/http.js'
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)
import base from './assets/base.js'
Vue.use(base)

import ElementUI from 'element-ui'
Vue.use(ElementUI)
import './assets/elementScss.scss'

import ViewUI from 'view-design'
import 'view-design/dist/styles/iview.css'
import './assets/index.less';
Vue.use(ViewUI)

import VueIntro from 'vue-introjs'
Vue.use(VueIntro)
import 'intro.js/introjs.css'

import "./icons/index"; // icon

import Echarts from 'echarts'
Vue.prototype.echarts = Echarts
Vue.use(Echarts)

// 百度地图
import BaiduMap from 'vue-baidu-map'
Vue.use(BaiduMap, {
  ak: '9meFZIIUYALAnFGxXNu9rB082eCdEH2M'
})

import XLSX from 'xlsx'
Vue.use(XLSX)

import lrz from 'lrz'
import axios from 'axios'
Vue.config.productionTip = false

import components from './components/index.js'
Object.keys(components).forEach((key) => {
  var name = key.replace(/(\w)/, (v) => v.toUpperCase())
  Vue.component(`vue${name}`, components[key])
})
axios.defaults.baseURL = '/'  // axios请求的初始路径
// Vue.prototype.$api = ''; // 上线时开启，把反向代理关掉即可，线上不存在跨域，存在也是后端解决
Vue.prototype.$api = '/api'; // 本地开发，开启反向代理

new Vue({
  el: '#app',
  router,
  store,
  components: {
    App
  },
  template: '<App/>'
})